//  https://www.luogu.com.cn/problem/P2946

#include<iostream>
using namespace std;

const int N = 2010, M = 1010, MOD = 1e8;
int dp[N][M];
int a[N], n, m;

int main()
{
    cin >> n >> m;
    for (int i = 1;i <= n;i++) cin >> a[i];

    dp[0][0] = 1;
    for (int i = 1;i <= n;i++)
    {
        for (int j = 0;j < m;j++)
            dp[i][j] = (dp[i - 1][j] + dp[i - 1][((j - a[i] % m) % m + m) % m]) % MOD;
    }
    cout << dp[n][0] - 1 << endl;
    return 0;
}